<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>{$title}</title>
    <link rel="stylesheet" href="/admin/public.css">
    <script src="/public/jquery-1.12.3.min.js"></script>
    <script src="/public/calc.min.js"></script>
    <script src="/admin/layui/layui.js"></script>
    <script src="/admin/echarts.min.js"></script>
    <script src="/admin/ajax.js"></script>
    <link rel="stylesheet" href="/admin/layui/css/layui.css" >
    <link rel="stylesheet" href="/admin/layui_exts/select/formSelects-v4.css">
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo"><a href="{:url('Home/index')}" style="color: #009688">{$title}</a></div>
        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item" id="setSubstation"><a href="javascript:;">{notempty name="SubstationName"}{$SubstationName}{gt name="userListCount" value="1"}，点击修改{/gt}{else/}设置当前管理网站{/notempty}</a></li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <img src="//tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg" class="layui-nav-img">
                    {$ADMIN.nick_name|default=$ADMIN.admin_name}
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="">基本资料</a></dd>
                    <dd><a href="">安全设置</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item"><a href="{:url('Login/loginOut')}">退出</a></li>
        </ul>
    </div>
    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <ul class="layui-nav layui-nav-tree" id="index-menu">
                {notempty name="userMenuList"}
                {volist name="userMenuList" id="vo"}
                <li class="layui-nav-item layui-nav-itemed">
                    <a  {eq name="vo.type" value="AJAX链接"}href="javascript:;"{else/}href="{:url($vo['menu_url'])}"{/eq}>{$vo.menu_name}</a>
                    {notempty name="vo.subset"}
                    <dl class="layui-nav-child">
                        {volist name="vo.subset" id="svo"}
                        <dd><a {eq name="svo.type" value="AJAX链接"}href="javascript:;"{else/}href="{:url($svo['menu_url'])}"{/eq} data-url="{:url($svo['menu_url'])}">{$svo.menu_name}</a></dd>
                        {/volist}
                    </dl>
                    {/notempty}
                </li>
                {/volist}
                {/notempty}
            </ul>
        </div>
    </div>
    <div class="layui-body">
        <blockquote class="layui-elem-quote">欢迎你，{$ADMIN.nick_name|default=$ADMIN.admin_name}！，上次登录时间：{neq name="LoginRecord.last_time" value="未激活"}{$LoginRecord.last_time}，上次登录IP：{$LoginRecord.update_ip|default=""}{else/}首次登陆{/neq}</blockquote>
    </div>
    <div class="layui-footer">
        © {$title}
    </div>
</div>
<script>
    layui.config({
        base: '/admin/layui_exts/'
    }).extend({
        formSelects: 'select/formSelects-v4.min'
    });
    //JavaScript代码区域
    layui.use('element', function(){
        var element = layui.element;
    });
    $(function () {
        //菜单点击事件
        $("#index-menu").find("a").click(function () {
            var url = $(this).attr("data-url");
            //链接不为空
            if(!isNull(url)){
                menu_sub(url,{});
            }
        });
        //网站选择事件
        $("#setSubstation").click(function () {
            $("#setSubstation").removeClass("layui-this");//取消原本点击事件
            {gt name="userListCount" value="1"}
            layer.open({
                type: 2,
                title:"设置当前管理网站",
                area: ["40%", "60%"],
                skin: 'layui-layer-rim',
                fixed: false, //不固定
                maxmin: false,
                resize:false,
                content: "{:url('Home/setSubstation')}",
                end:function () {
                    if(table) {
                        table.reload('testReload');
                    }
                },
            });
            {/gt}
        });
    });
</script>
</body>
</html>